function findIndex(array, fn){
    let result, a = -1
    const len = array.length
    while (++a < len) {
        if (fn(array[a], a, array)) {
            result = a
            break
        }
    }
    return result
}

export default findIndex